(() => {
  var navGoodsDom = document.querySelectorAll(".motif");
  var navGoodsDom1 = document.querySelectorAll(".nav_goods");
  navGoodsDom.forEach((item, index) => {
    item.addEventListener("click", () => nacGoodsNav(index));
  });
  function nacGoodsNav(index) {
    navGoodsDom1.forEach((dom, i) => {
      if (i == index) {
        Array.from(dom.children).forEach((child, ci) => {
          child.classList.add("goods_act");
          if (ci != 0 && ci != 1) {
            child.style.borderTop = " 1px dashed #b4b5b0";
          } else {
            child.style.borderTop = " 1px dashed #FFF";
          }
        });
      } else {
        Array.from(dom.children).forEach((child) => {
          child.classList.remove("goods_act");
        });
      }
    });
  }
})();
